import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: () => import('../views/Index.vue')
  },
  {
    path: '/user',
    name: 'PersonalCenter',
    component: () => import('../views/PersonalCenter.vue')
  },
  {
    
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/Register.vue')
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue')
  },
  {
    path: '/plate/:id',
    name: 'plate',
    component: () => import('../views/Plate.vue')
  },
  {
    path: '/page/:id',
    name: 'Page',
    props:true,
    component: () => import('../views/Page.vue')
  },
  {
    path: '/newPage',
    name: 'newPage',
    component: () => import('../views/NewPage.vue')
  },
  {
    path: '/admin/plate',
    name: 'PlateAdmin',
    component: () => import('../views/admin/PlateAdmin.vue')
  },
  {
    path:'/admin/pageType',
    name:'PageTypeAdmin',
    component: ()=>import('../views/admin/PageTypeAdmin.vue')
  },
  {
    path:'/admin/page',
    name:'PageAdmin',
    component: ()=>import('../views/admin/PageAdmin.vue')
  },
  {
    path:'/admin/category',
    name:'CategoryAdmin',
    props:true,
    component: ()=>import('../views/admin/CategoryAdmin.vue')
  }
  ,
  {
    path:'/admin/user',
    name:'UserAdmin',
    component: ()=>import('../views/admin/UserAdmin.vue')
  },
  {
    path:'/admin/notice',
    name:'NoticeAdmin',
    component: ()=>import('../views/admin/NoticeAdmin.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
